
const {commentMod}=require('../mod/commentMod.js');

module.exports.createCom =async function(Info){
  let data =await commentMod.create(Info);
}

module.exports.getCom=async function(Info){
  let data =await commentMod.find({AritcleId:Info.id}).populate({
    path:'parentCom'
  });
  return data;
}

module.exports.getAllCom=async function(){
  let data =await commentMod.find().populate({
    path:'AritcleId'
  });
  return data;
}

module.exports.DeleteCom=async function(Info){
  let data =await commentMod.remove({_id:Info.id});
}

module.exports.DeleteArticle=async function(Info){
  let data =await commentMod.remove({AritcleId:Info.AritcleId});
}